﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace PTCapture.PatientInfo
{
    /// <summary>
    /// For serialization
    /// </summary>
    [Serializable()]
    [XmlRoot("PatientList")]
    public class PatientList
    {
        [XmlArray("Patients")]
        [XmlArrayItem("Patient", typeof(Patient))]
        public List<Patient> Items { get; set; }
    }

    [Serializable()]
    public class Patient
    {
        [XmlElement("FirstName")]
        public string FirstName { get; set; }

        [XmlElement("LastName")]
        public string LastName { get; set; }

        [XmlElement("Address1")]
        public string Address1 { get; set; }

        [XmlElement("Address2")]
        public string Address2 { get; set; }

        [XmlElement("City")]
        public string City { get; set; }

        [XmlElement("State")]
        public string State { get; set; }

        [XmlElement("ZIP")]
        public string ZIP { get; set; }

        [XmlElement("PrimaryPhone")]
        public string PrimaryPhone { get; set; }

        [XmlElement("SecondaryPhone")]
        public string SecondaryPhone { get; set; }

        [XmlArray("AssignedExercises")]
        public List<AssignedExercise> AssignedExercises { get; set; }

        public Patient()
        {
        }

        public Patient(string firstName, string lastName, string address1, string address2, string city,
            string state, string zip, string primaryPhone, string secondaryPhone)
        {
            FirstName = firstName;
            LastName = lastName;
            Address1 = address1;
            Address2 = address2;
            City = city;
            State = state;
            ZIP = zip;
            PrimaryPhone = primaryPhone;
            SecondaryPhone = secondaryPhone;

            AssignedExercises = new List<AssignedExercise>();
        }
    }
}
